package leetcode;

/***
 * 题目：阶乘后的0
 * 链接:https://leetcode.cn/problems/factorial-trailing-zeroes/
 *
 */
public class TrailingZeroes {
    public static void main(String[] args) {
        System.out.println(trailingZeroes(13));
    }
    public static int trailingZeroes(int n) {
        // 求出阶乘，针对阶乘求0
        int ans = 0;
        while (n != 0) {
            n /= 5;
            ans += n;
        }
        return ans;
    }
}
